<template>
  <div id="myChart" :style="{width: '500px', height: '350px'}"></div>
</template>

<script>
export default {
  name: "hello",
  data() {
    return {
      msg: "Welcome to Your Vue.js App"
    };
  },
  mounted() {
    this.drawLine();
  },
  methods: {
    drawLine() {
      let myChart = this.$echarts.init(document.getElementById("myChart"));
      myChart.setOption({
        // title: { text: '单会话消息数统计' },
        tooltip: {},
        grid: {
          // x: "12%",//x 偏移量
          // y: "20%", // y 偏移量
          width: "90%", // 宽度
          height: "70%" // 高度
        },
        xAxis: {
          data: ["0-10", "10-20", "20-30", "30-40", "40-50"]
        },
        yAxis: {},
        series: [
          {
            name: "会话消息数",
            type: "bar",
            barWidth: 30,
            data: [7, 8, 10, 6, 5],
            barGap:'5%',
            barCategoryGap:'50%',
            itemStyle: { normal: { color: "	#006effe5" } }
            
          }
        ]
      });
    }
  }
};
</script>

<style>
</style>